<template>
  <u-page class="example-uRefresh" title="上滑加载">
    <u-refresh :url="dataMap.url" @upCallback="dataMap.upCallback" ref="mescrollItem" :useUp="dataMap.type === 'up'">
      <template #data="{index}">
        <view class="detail">{{index}}</view>
      </template>
    </u-refresh>
  </u-page>
</template>
<script lang="ts">
export default {
  name: 'exampleRefresh'
}
</script>

<script lang="ts" setup>
import { reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const GET_LIST_CGI = '/demo/home/list' // 列表
const dataMap = reactive({
  url: GET_LIST_CGI,
  type: '',
  upCallback() {

  }
})
onLoad((option) => {
  dataMap.type = option.type as string
})
</script>

<style lang="scss">
.example-uRefresh {
  .detail {
    height: 220rpx;
    border-bottom: 20rpx solid #ccc;
  }
}
</style>
